3.90 \(\int \frac{\tan (x)}{\sqrt{1+\cos ^2(x)}} \, dx\)

Optimal. Leaf size=11 \[ \tanh ^{-1}\left (\sqrt{\cos ^2(x)+1}\right ) \]

[Out]

ArcTanh[Sqrt[1 + Cos[x]^2]]

________________________________________________________________________________________

Rubi [A]  time = 0.0352519, antiderivative size = 11, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.231, Rules used = {3194, 63, 207} \[ \tanh ^{-1}\left (\sqrt{\cos ^2(x)+1}\right ) \]

Antiderivative was successfully verified.

[In]

Int[Tan[x]/Sqrt[1 + Cos[x]^2],x]

[Out]

ArcTanh[Sqrt[1 + Cos[x]^2]]

Rule 3194

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> With[{ff = Free
Factors[Sin[e + f*x]^2, x]}, Dist[ff^((m + 1)/2)/(2*f), Subst[Int[(x^((m - 1)/2)*(a + b*ff*x)^p)/(1 - ff*x)^((
m + 1)/2), x], x, Sin[e + f*x]^2/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rule 63

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - (a*d)/b + (d*x^p)/b)^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 207

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{\tan (x)}{\sqrt{1+\cos ^2(x)}} \, dx &=-\left (\frac{1}{2} \operatorname{Subst}\left (\int \frac{1}{x \sqrt{1+x}} \, dx,x,\cos ^2(x)\right )\right )\\ &=-\operatorname{Subst}\left (\int \frac{1}{-1+x^2} \, dx,x,\sqrt{1+\cos ^2(x)}\right )\\ &=\tanh ^{-1}\left (\sqrt{1+\cos ^2(x)}\right )\\ \end{align*}

Mathematica [A]  time = 0.0103894, size = 11, normalized size = 1. \[ \tanh ^{-1}\left (\sqrt{\cos ^2(x)+1}\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[x]/Sqrt[1 + Cos[x]^2],x]

[Out]

ArcTanh[Sqrt[1 + Cos[x]^2]]

________________________________________________________________________________________

Maple [A]  time = 0.019, size = 10, normalized size = 0.9 \begin{align*}{\it Artanh} \left ({\frac{1}{\sqrt{1+ \left ( \cos \left ( x \right ) \right ) ^{2}}}} \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(x)/(1+cos(x)^2)^(1/2),x)

[Out]

arctanh(1/(1+cos(x)^2)^(1/2))

________________________________________________________________________________________

Maxima [B]  time = 1.45679, size = 81, normalized size = 7.36 \begin{align*} \frac{1}{2} \, \log \left (\frac{\sqrt{-\sin \left (x\right )^{2} + 2}}{\sin \left (x\right ) + 1} + \frac{1}{\sin \left (x\right ) + 1} - 1\right ) + \frac{1}{2} \, \log \left (-\frac{\sqrt{-\sin \left (x\right )^{2} + 2}}{\sin \left (x\right ) - 1} - \frac{1}{\sin \left (x\right ) - 1} + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)/(1+cos(x)^2)^(1/2),x, algorithm="maxima")

[Out]

1/2*log(sqrt(-sin(x)^2 + 2)/(sin(x) + 1) + 1/(sin(x) + 1) - 1) + 1/2*log(-sqrt(-sin(x)^2 + 2)/(sin(x) - 1) - 1
/(sin(x) - 1) + 1)

________________________________________________________________________________________

Fricas [A]  time = 1.87163, size = 51, normalized size = 4.64 \begin{align*} \log \left (\frac{\sqrt{\cos \left (x\right )^{2} + 1} + 1}{\cos \left (x\right )}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)/(1+cos(x)^2)^(1/2),x, algorithm="fricas")

[Out]

log((sqrt(cos(x)^2 + 1) + 1)/cos(x))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\tan{\left (x \right )}}{\sqrt{\cos ^{2}{\left (x \right )} + 1}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)/(1+cos(x)**2)**(1/2),x)

[Out]

Integral(tan(x)/sqrt(cos(x)**2 + 1), x)

________________________________________________________________________________________

Giac [B]  time = 1.16387, size = 36, normalized size = 3.27 \begin{align*} \frac{1}{2} \, \log \left (\sqrt{\cos \left (x\right )^{2} + 1} + 1\right ) - \frac{1}{2} \, \log \left (\sqrt{\cos \left (x\right )^{2} + 1} - 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)/(1+cos(x)^2)^(1/2),x, algorithm="giac")

[Out]

1/2*log(sqrt(cos(x)^2 + 1) + 1) - 1/2*log(sqrt(cos(x)^2 + 1) - 1)